{extends file="layout.tpl"}
{block name="content"}
<div class="page">
	<div class="page-title"><h2>Thống kê đầu đuôi Lôtô</h2></div>
	<div class="page-content mt10 _pd5">
		<form method="post">
			<div class="fieldset clr">
				<div class="input-box">
					<label for="date_from" class="lable">Hiển thị</label>
					<input class="input" type="text" onkeypress="return isNumber(event);" maxlength="2" name="display" value="{$display}" /> Kết quả
				</div>
				<div class="input-box">
					<label for="date_to" class="lable">Đến ngày</label>
					<input class="input date" type="text" name="date_to" value="{$date_to}" /><img alt="..." src="{url path="images/calendar.gif"}">
				</div>
				<div class="input-box">
					{$city_html}
				</div>
				<div class="actions">
					<button class="button" type="submit" >
						<span>Xem kết quả</span>
					</button>
				</div>
			</div>
		</form>
		<div class="box-show ">
			<h4><span>Thống kê đầu đuôi KQXS <strong class="red uper">{$city_name}</strong> đến ngày <strong class="red">{$date_to}</strong></span></h4>
			<div class="tthead mt10">Đầu Lôtô trong <strong class="red">{$display}</strong> ngày</div>
			<table class="table list-least box-svip" bordercolor="#CCCCCC" border="1" cellspacing="0" cellpadding="0">
				<thead>
					<tr class="head-std">
						<th class="strong" width="15%">Ngày\Đầu</th>
						<th class="strong">0</th>
						<th class="strong">1</th>
						<th class="strong">2</th>
						<th class="strong">3</th>
						<th class="strong">4</th>
						<th class="strong">5</th>
						<th class="strong">6</th>
						<th class="strong">7</th>
						<th class="strong">8</th>
						<th class="strong">9</th>
					</tr>
				</thead>
				<tbody>
					{foreach $headends as $day=>$headend}
						<tr class="hvo cu">
							<td class="bot-head"><strong>{fdate($day,'%d-%m-%Y')}</strong></td>
							{foreach $headend as $n=>$head}
								<td><strong>{$head} lần</strong></td>
							{/foreach}
						</tr>
					{/foreach}
				</tbody>
				<tfoot>
					<tr>
						<td><strong>Tổng cộng</strong></td>
						{$t}
					</tr>
				</tfoot>
			</table>
			<div class="tthead mt20">Đuôi Lôtô trong <strong class="red">{$display}</strong> ngày</div>
			<table class="table list-least box-svip" bordercolor="#CCCCCC" border="1" cellspacing="0" cellpadding="0">
				<thead>
					<tr class="head-std">
						<th class="strong" width="15%">Ngày\Đầu</th>
						<th class="strong">0</th>
						<th class="strong">1</th>
						<th class="strong">2</th>
						<th class="strong">3</th>
						<th class="strong">4</th>
						<th class="strong">5</th>
						<th class="strong">6</th>
						<th class="strong">7</th>
						<th class="strong">8</th>
						<th class="strong">9</th>
					</tr>
				</thead>
				<tbody>
					{foreach $headends2 as $day=>$headend}
						<tr class="hvo cu">
							<td class="bot-head"><strong>{fdate($day,'%d-%m-%Y')}</strong></td>
							{foreach $headend as $n=>$head}
								<td><strong>{$head} lần</strong></td>
							{/foreach}
						</tr>
					{/foreach}
				</tbody>
				<tfoot>
					<tr>
						<td><strong>Tổng cộng</strong></td>
						{$t2}
					</tr>
				</tfoot>
			</table>
		</div>
	</div>
</div>
{/block}